package com.cjk.foundation.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.cjk.foundation.entity.EmployeeEntity;

@Repository
public interface EmployeeDao {

	public void insert(EmployeeEntity employeeEntity);
	
	public EmployeeEntity selectByUsername(@Param("username") String username);
	
	public List<EmployeeEntity> selectListByCondition(@Param("page") Integer page, @Param("pageSize") Integer pageSize);
	
	public Integer selectCountByCondition();
	
	public void update(@Param("id") Integer id, @Param("password") byte[] password, @Param("roleId") Integer roleId);
	
	@Delete("delete from employee where id = #{id}")
	public void delete(@Param("id") Integer id);
	
	@ResultMap("resultMap")
	@Select("select id, role_id, username from employee where id = #{id}")
	public EmployeeEntity selectById(@Param("id") Integer id);
}
